import request from './request';

// 发送验证码
export const sendCode = (phone: string) => {
  return request.get(`/auth/msm/sendmessage?phone=${phone}`);
};
// 注册
export const register = (data: any) => {
  return request.post('/auth/register', data);
};
// 登录
export const login = (username: string, password: string) => {
  return request.post(`/auth/login`, {
    username,
    password,
  });
};
// 退出
export const logout = () => {
  return request.delete('/auth/logout');
};
// 找回密码-验证账号
export const verifyUsername = (userName: string) => {
  return request.post('/auth/findPassword', { userName });
};
// 找回密码-发送验证码
export const findPWSendCode = (phone: string) => {
  return request.get(`/auth/msm/findpwmessage?phone=${phone}`);
};
// 找回密码-修改密码
export const alterPassword = (query: any) => {
  return request.post(`/auth/alterPassword`, query);
};
